/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package utils;

import com.sun.awt.AWTUtilities;
import java.util.TimerTask;
import javax.swing.JFrame;

/**
 *
 * @author juju
 */
public class Fader extends TimerTask{
    private JFrame myFrame;
        public Fader(JFrame frm) { 
            this.myFrame = frm; 
        }

    @Override
    public void run() {
        if(AWTUtilities.getWindowOpacity(myFrame) > 0.01f){
            AWTUtilities.setWindowOpacity(myFrame,AWTUtilities.getWindowOpacity(myFrame)-0.01f);
        } else { myFrame.dispose(); }

    }
    
}
